<?

class database {
    public $host = 'localhost';
    public $user = 'alexseyka1';
    public $pass = '413465894';
    public $dbase = 'fresh';
    
    public function connect(){
        $ret = mysql_connect($this->host,$this->user,$this->pass);
        mysql_select_db($this->dbase);
        return $ret;
    }
    public function select($s_what,$s_from,$s_where){
        $s_ret = mysql_query('SELECT '.$s_what.' FROM '.$s_from.' WHERE '.$s_where);
        return mysql_fetch_array($s_ret);
    }
    public function insert($i_into,$i_values){
        $i_ret = mysql_query("INSERT INTO ".$i_into." VALUES (".$i_values.")");
        return $i_ret;
    }
    public function update($u_table,$u_value,$u_where){
        $u_ret = mysql_query('UPDATE '.$u_table.' SET '.$u_value.' WHERE '.$u_where);
        return $u_ret;
    }
    public function delete($d_what,$d_from,$d_where){
        $d_ret = mysql_query('DELETE '.$d_what.' FROM '.$d_from.' WHERE '.$d_where);
        return $d_ret;
    }
    
    
}

?>
